﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using Common.Utilities.Dispatcher;
using Workflows.Components.ETL.Properties;

namespace Workflows.Components.ETL
{
    /// <summary>
    /// 
    /// </summary>
    [Serializable]
    public class WebCrawlerComponnet:WorkflowComponentBase
    {
        private WebCrawlerInstruction _Instruction;
        private WebCrawlerOutput _Output;

        public override InstructionBase Instruction
        {
            get { return _Instruction; }
            set { _Instruction = (WebCrawlerInstruction)value; }
        }

        public override ResultBase Output
        {
            get { return _Output; }
            set { _Output = (WebCrawlerOutput)value; }
        }

        /// <summary>
        /// 
        /// </summary>
        public WebCrawlerComponnet():base()
        {
            this.ComponentActivityType = WorkflowActivityType.SimpleActivity;
            this.ComponentCategory = WorkflowComponentCategory.ETL.ToString();
            this.Description = "Web request";
            this.ComponentIcon = Resources.IE;
            this.ComponentImage = Resources.browser;
            this.ComponentName = "Web crawler";

            this._Instruction =
                new WebCrawlerInstruction(this.ComponentID, Guid.Empty, string.Empty, string.Empty, string.Empty, null);
            this._Output = new WebCrawlerOutput(Guid.Empty, Guid.Empty, string.Empty);
        }

        public override XmlNode Serialize(ref XmlDocument xDoc, ref XmlNode parentNode)
        {
            XmlNode xNode = base.Serialize(ref xDoc, ref parentNode);

            return xNode;
        }

        public override WorkflowComponentBase Instantiate(XmlNode xNode)
        {
            throw new NotImplementedException();
        }
    }
}
